Skip to content

Roll forward io expansion service to Java17#38974

Merged
derrickaw merged 7 commits into
masterfrom
20260615_rollForwardIOExpansionJava17
Jun 21, 2026
Merged

Roll forward io expansion service to Java17#38974
derrickaw merged 7 commits into
masterfrom
20260615_rollForwardIOExpansionJava17

Conversation

@derrickaw

Copy link
Copy Markdown
Collaborator

First iteration that was reverted - #38931


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.72%. Comparing base (6ed0635) to head (88ac876).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #38974      +/-   ##
============================================
- Coverage     60.25%   57.72%   -2.54%     
+ Complexity    20572    13032    -7540     
============================================
  Files          3318     2513     -805     
  Lines        315452   261376   -54076     
  Branches      17142    10722    -6420     
============================================
- Hits         190073   150868   -39205     
+ Misses       116830   104796   -12034     
+ Partials       8549     5712    -2837     
Flag Coverage Δ
java 64.22% <ø> (-2.84%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@derrickaw

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Java version requirement for the expansion service from Java 11 to Java 17. Specifically, it updates the base Docker image to eclipse-temurin:17 and modifies the Gradle build configuration to require JavaVersion.VERSION_17, noting that Delta Lake requires Java 17+. There are no review comments, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@derrickaw derrickaw force-pushed the 20260615_rollForwardIOExpansionJava17 branch 2 times, most recently from 898e6d6 to 5ea0a53 Compare June 16, 2026 16:42
@derrickaw derrickaw force-pushed the 20260615_rollForwardIOExpansionJava17 branch from 5ea0a53 to d8735a1 Compare June 16, 2026 16:44
@derrickaw

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request upgrades the Java environment requirements to Java 17 for the expansion service, updates the setup-java action to v4, and automatically configures Java home properties in the Gradle build configuration using environment variables. Feedback suggests refactoring the Gradle plugin logic to support ARM64 runners by checking both _X64 and _ARM64 environment variables, which can be simplified using a Groovy loop.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy Outdated
@derrickaw derrickaw marked this pull request as ready for review June 17, 2026 19:11
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request facilitates the migration of the IO expansion service to Java 17. It includes necessary updates to build configurations, CI/CD environment setups, and container definitions to ensure compatibility with modern Java requirements and dependencies.

Highlights

  • Java 17 Migration: Updated the IO expansion service to require Java 17, aligning with dependencies like Delta Lake.
  • Infrastructure Updates: Modified GitHub Actions and Dockerfiles to support Java 17 as the default runtime environment.
  • Gradle Configuration: Enhanced BeamModulePlugin to automatically detect local Java 17+ home paths and redirect JavaExec tasks to the configured JDK.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (13)
    • .github/workflows/beam_PerformanceTests_xlang_KafkaIO_Python.yml
    • .github/workflows/beam_PostCommit_Python_Xlang_Gcp_Dataflow.yml
    • .github/workflows/beam_PostCommit_Python_Xlang_Gcp_Direct.yml
    • .github/workflows/beam_PostCommit_Python_Xlang_IO_Dataflow.yml
    • .github/workflows/beam_PostCommit_Python_Xlang_IO_Direct.yml
    • .github/workflows/beam_PostCommit_TransformService_Direct.yml
    • .github/workflows/beam_PostCommit_XVR_Direct.yml
    • .github/workflows/beam_PostCommit_Yaml_Xlang_Direct.yml
    • .github/workflows/beam_PreCommit_Xlang_Generated_Transforms.yml
    • .github/workflows/beam_PreCommit_Yaml_Xlang_Direct.yml
    • .github/workflows/beam_Publish_Beam_SDK_Snapshots.yml
    • .github/workflows/build_release_candidate.yml
    • .github/workflows/typescript_tests.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Java environment configuration to support Java 17, including adding a Java 17 fallback installation in GitHub Actions, updating the expansion service Dockerfile base image to Java 17, and requiring Java 17 for the IO expansion service. Additionally, it configures Gradle to dynamically set JDK home properties and redirect JavaExec tasks to the specified JDK. Feedback points out that the Java 17 fallback installation path is overwritten and lost by the subsequent Java installation step, and suggests explicitly exporting the path. Another comment recommends adding a null check for testJavaHome before configuring JavaExec tasks to prevent build failures when the JDK path is unresolved.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread .github/actions/setup-environment-action/action.yml Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @ahmedabu98 for label java.
R: @Abacn for label build.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

if: ${{ inputs.java-version == 'default' }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'

@Abacn Abacn Jun 18, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now java-version set to default means to install both Java11 and 17. This may work for fixing some test but makes future maintenance harder (more complex and implicit java version logic) and also making future breaking changes that effectively invalidate Java11 support (combine with the env fallback below) slips in

I would prefer make Java17 requirement explicit that is explicitly change java-version to "17 11" for the affected GHA workflows

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed, thanks for the clarification

def propName = "java${version}Home"
if (!project.hasProperty(propName)) {
def home = System.getenv("JAVA_HOME_${version}_X64") ?:
(System.getenv("JAVA_HOME_${version}_ARM64") ?: System.getenv("JAVA_HOME_${version}_arm64"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beam module plugin should be independent of GitHub Action specific arangement. Better avoiding further complicated fallback mechanism and/or making our build system tied to GitHub Action infra

Doesn't setting java17Home property in individual tests work?

@derrickaw derrickaw Jun 18, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to verify in separate branch. All good now. Thanks.

https://github.com/apache/beam/actions/runs/27788956936/job/82232825777

@derrickaw derrickaw force-pushed the 20260615_rollForwardIOExpansionJava17 branch from c6bbc7d to 4381a8f Compare June 18, 2026 20:31
@derrickaw derrickaw requested a review from Abacn June 18, 2026 23:44

@Abacn Abacn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Compared to the previous version, the change should be noop for most tests. We can fix foward if any other version tests need Java17+

@derrickaw derrickaw merged commit e948ef6 into master Jun 21, 2026
64 of 68 checks passed
@derrickaw derrickaw deleted the 20260615_rollForwardIOExpansionJava17 branch June 21, 2026 02:57
peterphitran added a commit to peterphitran/beam that referenced this pull request Jun 22, 2026
Bumping the iceberg module to Java 17 (Iceberg 1.11.0 dropped Java 11)
breaks the Java 11 modules that depend on it, because Gradle's
JVM-version variant resolution refuses to let a Java 11 consumer depend
on a Java 17 library. Raise requireJavaVersion 11 -> 17 in:

  - sdks/java/extensions/sql/iceberg
  - examples/java/iceberg

The Java IO expansion service (sdks/java/io/expansion-service) also
depends on IcebergIO but was already raised to Java 17 on master in
apache#38974 (for Delta Lake), so it needs no change here.

For apache#38925

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
peterphitran added a commit to peterphitran/beam that referenced this pull request Jun 22, 2026
Bumping the iceberg module to Java 17 (Iceberg 1.11.0 dropped Java 11)
breaks the Java 11 modules that depend on it, because Gradle's
JVM-version variant resolution refuses to let a Java 11 consumer depend
on a Java 17 library. Raise requireJavaVersion 11 -> 17 in:

  - sdks/java/extensions/sql/iceberg
  - examples/java/iceberg

The Java IO expansion service (sdks/java/io/expansion-service) also
depends on IcebergIO but was already raised to Java 17 on master in
apache#38974 (for Delta Lake), so it needs no change here.

For apache#38925

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
peterphitran added a commit to peterphitran/beam that referenced this pull request Jun 23, 2026
The cross-language wrapper validation launches the io expansion-service jar from Python via JAVA_HOME. That jar bundles IcebergIO, which is now Java 17 bytecode, so launching it on the default Java 11 fails with UnsupportedClassVersionError.

createCrossLanguageUsingJavaExpansionTask was missing the testJavaHome -> JAVA_HOME redirect that apache#38974 added to the other cross-language task factories. Add it, and pass -PtestJavaVersion=17 in the precommit workflow so the expansion service runs on Java 17.
peterphitran added a commit to peterphitran/beam that referenced this pull request Jun 23, 2026
The cross-language wrapper validation launches the io expansion-service jar from Python via JAVA_HOME. That jar bundles IcebergIO, now Java 17 bytecode, so launching it on the default Java 11 fails with UnsupportedClassVersionError.

createCrossLanguageUsingJavaExpansionTask was missing the JAVA_HOME redirect that apache#38974 added to the other cross-language task factories. Add it, defaulting to java17Home (already provided to this build) so bundled Java 17 IOs can be loaded.
peterphitran added a commit to peterphitran/beam that referenced this pull request Jun 24, 2026
The cross-language wrapper validation launches the io expansion-service jar from Python via JAVA_HOME. That jar bundles IcebergIO, now Java 17 bytecode, so launching it on the default Java 11 fails with UnsupportedClassVersionError.

createCrossLanguageUsingJavaExpansionTask was missing the JAVA_HOME redirect that apache#38974 added to the other cross-language task factories. Add it, driven by -PtestJavaVersion (resolving java\Home), and pass -PtestJavaVersion=17 in the Xlang_Generated_Transforms precommit so the expansion service runs on a JDK that can load the bundled Java 17 IOs.
ash6898 pushed a commit to ash6898/beam that referenced this pull request Jun 28, 2026
* Second try moving io expansion service to Java17

* fixing xlang issue

* Fix cross-language CI by auto-discovering JDK homes and setting Java 17 as default

* invert java 11 / 17 order installation

* fix gemini

* fix gemini

* decouple BeamModulePlugin and setup-environment-action from GHA infra
ash6898 pushed a commit to ash6898/beam that referenced this pull request Jun 29, 2026
* Second try moving io expansion service to Java17

* fixing xlang issue

* Fix cross-language CI by auto-discovering JDK homes and setting Java 17 as default

* invert java 11 / 17 order installation

* fix gemini

* fix gemini

* decouple BeamModulePlugin and setup-environment-action from GHA infra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants